import request from '@/utils/axios-req'
const SERVERURL = import.meta.env.VITE_APP_BASE_MIAN_URL

// const SERVERURL = 'http://localhost:8000'

// ### 对上传文件进行AI预测
export const uploadPredict = (id) => {
    return request({
      url: `${SERVERURL}/ai/uploadpredict/${id}`,
      reqLoading: false,
      method: 'get'
    })
}
// ### 对转换文件进行AI预测
export const convertPredict = (id) => {
    return request({
      url: `${SERVERURL}/ai/convertpredict/${id}`,
      reqLoading: false,
      method: 'get'
    })
}
// ### 获取预测文件列表
export const getPredictList = ({ page, size }) => {
    return request({
      url: `${SERVERURL}/ai/list?skip=${page}&limit=${size}`,
      reqLoading: false,
      method: 'get'
    })
}
// ### 获取预测文件详情
export const getPredictDetail = (id) => {
    return request({
      url: `${SERVERURL}/ai/list/${id}`,
      reqLoading: false,
      method: 'get'
    })
}
// ### 下载预测
export const downloadPredictFile = (id) => {
    return request({
      url: `${SERVERURL}/ai/list/${id}/download`,
      reqLoading: false,
      method: 'get'
    })
}
// ### AI预测，根据上传文件ID<upload_id>
// GET http://127.0.0.1:8000/ai/uploadpredict/1
// Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqYXkzMjIyMSIsImV4cCI6MTcxNTE4ODYwMX0.De_Zo8vaFlaVGfnemA-uEk3kZcsG8RQBmQ4Xvzzbl-Y

// ### AI预测，根据上传文件ID<convert_id>
// GET http://127.0.0.1:8000/ai/convertpredict/1
// Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqYXkzMjIyMSIsImV4cCI6MTcxNTE4ODYwMX0.De_Zo8vaFlaVGfnemA-uEk3kZcsG8RQBmQ4Xvzzbl-Y

// ### 已预测列表
// GET http://127.0.0.1:8000/ai/list
// Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqYXkzMjIyMSIsImV4cCI6MTcxNTE4ODYwMX0.De_Zo8vaFlaVGfnemA-uEk3kZcsG8RQBmQ4Xvzzbl-Y

// ### 预测详情
// GET http://127.0.0.1:8000/ai/list/15
// Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqYXkzMjIyMSIsImV4cCI6MTcxNTE4ODYwMX0.De_Zo8vaFlaVGfnemA-uEk3kZcsG8RQBmQ4Xvzzbl-Y

// ### 下载文件
// GET http://127.0.0.1:8000/ai/list/15/download
// Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqYXkzMjIyMSIsImV4cCI6MTcxNTE4ODYwMX0.De_Zo8vaFlaVGfnemA-uEk3kZcsG8RQBmQ4Xvzzbl-Y